import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import numpy as np
from scipy.stats import pearsonr

df = pd.read_csv('tips.csv')
print(df[:5])

j = sns.jointplot(x='total_bill',
              y='tip',
              data=df,
              kind='scatter',
              )
j.annotate(pearsonr)
plt.show()


x1 = np.random.randn(1000)
y1 = np.random.randn(1000)
# kind 联合分布图类型参数，默认scatter，还有kde
j2 = sns.jointplot(x=x1, y=y1, kind='kde')
j2.annotate(pearsonr)
plt.show()
